function authorfilter(authorArr) {
    if (authorArr.length <= 1) {
        return authorArr[0].name;
    } else {
        let temparr = [];
        authorArr.forEach(el => {
            temparr.push(el.name);
        });
        return temparr.join("/");
    }
}

function timefilter(time) {
    if (typeof time === "number") {
        time = time > 10000 ? time / 1000 : time;
        time = parseInt(time);
        let m = Math.floor(time / 60);
        m = m >= 10 ? m : `0${m}`;
        let s = time - m * 60;
        s = s >= 10 ? s : `0${s}`;
        return `${m}:${s}`;
    } else {
        return `00:00`;
    }
}

export default {
    authorfilter,
    timefilter
}